package cn.fws.meap.user.web;

import java.util.List;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import cn.fws.meap.user.entity.AccountRecord;
import cn.fws.meap.user.service.IAccountRecordService;
import cn.fws.framework.web.contoller.BaseController;
import cn.fws.framework.web.page.PagingResult;
import cn.fws.framework.web.contoller.JsonResponse;

/**
 * 账户充值消费记录 信息操作处理
 * 
 * @author chenkh
 * @date 2019-03-07
 */
@RestController
@RequestMapping("/meap/accountRecord")
@Api(tags = "账户充值消费记录 信息操作处理")
public class AccountRecordController extends BaseController{

	@Autowired
	private IAccountRecordService accountRecordService;
	
	/**
	 * 查询账户充值消费记录列表
	 */
	//@RequiresPermissions("meap:accountRecord:list")
	@ApiOperation(value = "查询账户充值消费记录列表")
	@PostMapping("/list")
	public PagingResult<AccountRecord> list(AccountRecord accountRecord){
		startPage();
        List<AccountRecord> list = accountRecordService.selectList(accountRecord);
		return getPagingResult(list);
	}
	
	/**
	 * 新增保存账户充值消费记录
	 */
	/*//@RequiresPermissions("meap:accountRecord:add")
	@ApiOperation("新增保存账户充值消费记录")
	@ApiImplicitParam(name = "accountRecord", value = "新增保存账户充值消费记录",dataType = "AccountRecord")
	@PostMapping("/add")
	public JsonResponse addSave(AccountRecord accountRecord)	{		
		return toAjax(accountRecordService.insert(accountRecord));
	}*/

	/**
	 * 修改保存账户充值消费记录
	 */
	//@RequiresPermissions("meap:accountRecord:edit")
	@ApiOperation("修改保存账户充值消费记录")
	@ApiImplicitParam(name = "accountRecord", value = "修改保存账户充值消费记录",dataType = "AccountRecord")
	@PutMapping("/edit")
	public JsonResponse editSave(AccountRecord accountRecord)	{		
		return toAjax(accountRecordService.update(accountRecord));
	}
	
	/**
	 * 删除账户充值消费记录
	 */
	//@RequiresPermissions("meap:accountRecord:remove")
	@ApiOperation("删除账户充值消费记录")
	@ApiImplicitParam(name = "ids", value = "根据id删除账户充值消费记录",dataType = "String")
	@DeleteMapping( "/remove")
	public JsonResponse remove(String ids)	{		
		return toAjax(accountRecordService.deleteByIds(ids));
	}
	
}
